import {defineStore} from "pinia";
import {ref} from "vue";
import {info} from "@/api/api";
import type {InfoType} from "@/util/publicType";

// 用户信息
export const useInfoStore = defineStore("info", () => {
    // 状态
    const infoData = ref<InfoType>({
        id: "",
        jurisdictions: [],
        created_at: 0,
        lasted_at: 0,
        username: ""
    });
    // 更新
    const setInfo = (newData: InfoType) => infoData.value = newData;
    return {infoData, setInfo}
});